
#ifndef NODE_H
#define NODE_H

#include <vector>
#include "vertex.h"
#include <string>

using std::vector;
using std::string;

class Node{
public:
	Node();
	Node(Vertex* state, Node* parent, int boardCost);

	void destroyNode(Node* t);
	void addChild(Node*);	//Takes a parent and child pointer
	void setChild(Node*);			//used if its a linear node list (queue)
	void setHasChild(bool value);	//Returns true if has child;
	void setfValue(float newfValue);	//Used to set the f(n);
	void setState(Vertex* state);	//Used to set the state;
	void setParent(Node*);			//Sets parent pointer;
	void printState();				//Used to print the node's members;

	string getData();				//Retrieves string data from a node;
	Vertex* getState();				//Returns pointer to node's state;
	int getPathCost();				//Returns g(n);
	float getfValue();				//Returns f(n);
	bool hasParent();				//Returns true of parent exists;
	void setHasParent(bool);		//Sets isRoot;
	bool hasChildren();				//Returns value of hasChild;
	Node* getParent();				//Returns pointer to parent;
	Node* getChild();				//Returns pointer to child;
	Node* next;					//Gets or sets right link in queue;

    public:
		bool hasChild;					//True is child exists;
		bool isRoot;					//True if no parent exists;
		Node* parent;					//Pointer to node's parent;
		std::string name;				//a text name for this node;
		Vertex* state;					//Holds current state
		int numberOfChildren;			//Number of children;
		std::vector <Node*> children;	//Vector of node's children;
		int pathCost;					//g(n) = parent's g(n)+1;
		float fValue;					//f(n) = h(n) + g(n);
};

#endif
